DateTimeTo2000 (dateTime, number)

Basic and Crystal syntax.

Arguments
Returns

a date-time field with a four digit year

Action

Note:    If the year is less than or equal to 1899 and greater or equal to 100, then there will be no change to the date.

Examples

The following examples are applicable to Basic and Crystal syntax:

Here the window value is greater than the year and so it will change it to 20XX.

DateTimeTo2000(CDateTime(1998,12,12,3,2,1), 99)

should return 2098/12/12 3:02:01

Here the window value is less than the year and so it will not change the year.

DateTimeTo2000(CDateTime(1995,1,2,3,2,1), 94)

should return 1995/01/02 3:02:01

Other Examples

These are examples of a date that will not be affected by the function.

DateTimeTo2000(CDateTime(1899,12,12,5,6,7), 99)

should return 1899/12/12 5:06:07

DateTimeTo2000(CDateTime(999,12,12,5,6,7), 99)

should return 999/12/12 5:06:07

Some databases maintain the year of a date as a two digit field and so these samples will simulate that date field.

DateTimeTo2000(CDateTime (93,12,12,5,6,7), 96)

should return 2093/12/12 5:06:07

DateTimeTo2000(CDateTime (98,12,12,5,6,7), 50)

should return 1998/12/12 5:06:07

DateTimeTo2000(CDateTime (9,12,12,5,6,7), 10)

should return 2009/12/12 5:06:07

DateTimeTo2000(CDateTime (2,12,12,5,6,7), 1)

should return 1902/12/12 5:06:07



Seagate Software IMG Holdings, Inc.
http://www.seagatesoftware.com
Support services:
http://support.seagatesoftware.com